/**********************************************
这是代码自动生成的，如果重新生成，所做的改动将会丢失
系统:gpssolution
模块:系统平台
Itop.com 版权所有
生成者：Rabbit
生成时间:2012-7-17 11:19:34
***********************************************/

using System;
using System.Threading;
using System.ComponentModel;
namespace Itop.GpsCar.Model
{
    /// <summary>
    ///[usergroup]业务实体类
    ///对应表名:usergroup
    /// </summary>
    [Serializable]
    public class usergroup
    {
        
        #region Private 成员
        private int _idusergroup=0; 
        private int _group_id=0; 
        private int _user_id=0; 
        private int _child_group_id=0; 
        private int _associated_level=0; 
        private DateTime _associated_time=new DateTime(1900,1,1); 
        private DateTime _timestamp=new DateTime(1900,1,1); 
        private string _reserved_1=String.Empty; 
        private string _reserved_2=String.Empty;   
        #endregion
  
  
        #region Public 成员
   
        /// <summary>
        /// 属性名称：idUserGroup
        /// 属性描述：
        /// 字段信息：[idUserGroup],INT UNSIGNED
        /// </summary>
        [Browsable(false)]
        [DisplayNameAttribute("")]
        public int idUserGroup
        {
            get { return _idusergroup; }
            set
            {			
                if (_idusergroup as object == null || !_idusergroup.Equals(value))
                {
                    _idusergroup = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：group_id
        /// 属性描述：
        /// 字段信息：[group_id],INT
        /// </summary>
        [DisplayNameAttribute("")]
        public int group_id
        {
            get { return _group_id; }
            set
            {			
                if (_group_id as object == null || !_group_id.Equals(value))
                {
                    _group_id = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：user_id
        /// 属性描述：
        /// 字段信息：[user_id],INT
        /// </summary>
        [DisplayNameAttribute("")]
        public int user_id
        {
            get { return _user_id; }
            set
            {			
                if (_user_id as object == null || !_user_id.Equals(value))
                {
                    _user_id = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：child_group_id
        /// 属性描述：
        /// 字段信息：[child_group_id],INT
        /// </summary>
        [DisplayNameAttribute("")]
        public int child_group_id
        {
            get { return _child_group_id; }
            set
            {			
                if (_child_group_id as object == null || !_child_group_id.Equals(value))
                {
                    _child_group_id = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：associated_level
        /// 属性描述：Associated_level to indicated child_group under which level of root group. for example: root->Child 1->Child2. it means Child 2 have leve 2 and Child 1 have level 1. For user, it will alwasy have level 0.
        /// 字段信息：[associated_level],INT
        /// </summary>
        [DisplayNameAttribute("Associated_level to indicated child_group under which level of root group. for example: root->Child 1->Child2. it means Child 2 have leve 2 and Child 1 have level 1. For user")]
        public int associated_level
        {
            get { return _associated_level; }
            set
            {			
                if (_associated_level as object == null || !_associated_level.Equals(value))
                {
                    _associated_level = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：associated_time
        /// 属性描述：
        /// 字段信息：[associated_time],DATETIME
        /// </summary>
        [DisplayNameAttribute("")]
        public DateTime associated_time
        {
            get { return _associated_time; }
            set
            {			
                if (_associated_time as object == null || !_associated_time.Equals(value))
                {
                    _associated_time = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：timestamp
        /// 属性描述：
        /// 字段信息：[timestamp],TIMESTAMP
        /// </summary>
        [DisplayNameAttribute("")]
        public DateTime timestamp
        {
            get { return _timestamp; }
            set
            {			
                if (_timestamp as object == null || !_timestamp.Equals(value))
                {
                    _timestamp = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：reserved_1
        /// 属性描述：
        /// 字段信息：[reserved_1],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string reserved_1
        {
            get { return _reserved_1; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_reserved_1 as object == null || !_reserved_1.Equals(value))
                {
                    _reserved_1 = value;
                }
            }			 
        }
  
        /// <summary>
        /// 属性名称：reserved_2
        /// 属性描述：
        /// 字段信息：[reserved_2],VARCHAR
        /// </summary>
        [DisplayNameAttribute("")]
        public string reserved_2
        {
            get { return _reserved_2; }
            set
            {			
                if(value==null)return;
                if( value.ToString().Length > 45)
                throw new Exception("[]长度不能大于45!");
                if (_reserved_2 as object == null || !_reserved_2.Equals(value))
                {
                    _reserved_2 = value;
                }
            }			 
        }
  
        #endregion 
  
        #region 方法
        public static string Newid(){
            return DateTime.Now.ToString("yyyyMMddHHmmssffffff");
        }
        public string CreateID(){
            Thread.Sleep(new TimeSpan(100000));//0.1毫秒
            return DateTime.Now.ToString("yyyyMMddHHmmssffffff");
        }
        #endregion		
    }	
}
